package com.lz.springboot.apollo.rabbit;
import java.io.IOException;
import java.util.Date;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import com.lz.springboot.rabbit.common.RabbitConstants;
import com.rabbitmq.client.Channel;

@Component
public class DirectReceiverA1 {

	@RabbitListener(queues = RabbitConfig.SPRINGBOOT_RABBIT_DIRECT_A_QUEUE, containerFactory=RabbitConstants.FIRST_RABBIT_CONTAINER_FACTORY)
	public void on(Message message, Channel channel) throws IOException{
		channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
		//System.out.println(new Date() + "DirectReceiverA1=" + new String(message.getBody()));
	}

}